package com.example.lijinyuan.baseandroid.Intent;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.lijinyuan.baseandroid.R;


/**
 * Created by lijinyuan on 15/10/26.
 */
public class BlankIntent extends Activity {
    TextView textView;
    Button button1, button2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.intent_blank_intent);
        textView = (TextView) findViewById(R.id.blank_intent_text);
        Intent intent = getIntent();
        String msg = intent.getStringExtra("from");
        textView.setText(msg);

        button1 = (Button) findViewById(R.id.to_exp_intent);

        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(BlankIntent.this, ExplicitIntent.class));
            }
        });

        button2 = (Button) findViewById(R.id.to_im_intent);
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(BlankIntent.this, ImplicitIntent.class));
            }
        });
    }
}
